package com.xuecheng.teaching.api;

import com.xuecheng.commons.model.dto.WorkDto;
import com.xuecheng.commons.model.vo.CourseWorkRecVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.commons.model.vo.WorkVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("xc-teaching-service")
public interface TeachingClient {
    //根据id查询试卷
    @GetMapping("/work/{workId}")
    public ResponseResult<WorkVo> findWorkById(@PathVariable Long workId);

    //新增或更新试卷
    @PostMapping("/work")
    public ResponseResult saveOrUpdateWork(@RequestBody WorkDto workDto);

    //根据课程发布id获取课程作业统计表
    @GetMapping("/coursework")
    public ResponseResult<CourseWorkRecVo> findIdByPubId(@RequestParam Long coursePubId);

    //获取课程内包含的作业数
    @GetMapping("/getGroupNum")
    public ResponseResult<Integer> getGroupNum(@RequestParam Long coursePubId);
}
